/*
 * @Author: weisheng
 * @Date: 2024-03-15 11:36:12
 * @LastEditTime: 2024-11-04 21:33:52
 * @LastEditors: weisheng
 * @Description:
 * @FilePath: \wot-design-uni\src\uni_modules\wot-design-uni\components\wd-button\types.ts
 * 记得注释
 */
import type { ExtractPropTypes, PropType } from 'vue'
import { baseProps, makeBooleanProp, makeNumericProp, makeStringProp } from '../common/props'

export type ButtonType = 'primary' | 'success' | 'info' | 'warning' | 'error' | 'default' | 'text' | 'icon'
export type ButtonSize = 'mini' | 'small' | 'normal' | 'large'
export type ButtonLang = 'zh_CN' | 'zh_TW' | 'en'

export type ButtonScope = 'phoneNumber' | 'userInfo'

export const buttonProps = {
  ...baseProps,
  /**
   * 幽灵按钮
   */
  plain: makeBooleanProp(false),
  /**
   * 填充按钮
   */
  fill: makeBooleanProp(false),
  /**
   * 圆角按钮
   */
  round: makeBooleanProp(true),
  /**
   * 禁用按钮
   */
  disabled: makeBooleanProp(false),
  /**
   * 是否细边框
   */
  hairline: makeBooleanProp(false),
  /**
   * 块状按钮
   */
  block: makeBooleanProp(false),
  /**
   * 按钮类型，可选值：primary / success / info / warning / error / text / icon
   */
  type: makeStringProp<ButtonType>('primary'),
  /**
   * 按钮尺寸，可选值：'mini' | 'small' | 'normal' | 'large'
   */
  size: makeStringProp<ButtonSize>('normal'),
  /**
   * 图标类名
   */
  icon: String,
  /**
   * 类名前缀，用于使用自定义图标，用法参考Icon组件
   */
  classPrefix: makeStringProp('wd-icon'),
  /**
   * 加载中按钮
   */
  loading: makeBooleanProp(false),
  /**
   * 指定是否阻止本节点的祖先节点出现点击态
   */
  hoverStopPropagation: Boolean,
  /**
   * 是否显示倒计时s 倒计时
   */
  countDown: makeBooleanProp(false),
  /**
   * 倒计时数字
   */
  countDownNum: makeNumericProp(60),
  /**
   * 倒计时文字
   */
  countDownText: makeStringProp('后重新获取'),
  /**
   * formType
   */
  formType: makeStringProp(''),
  dataParam: makeStringProp(''),
  lang: makeStringProp('zh_CN'),
  sessionFrom: makeStringProp(''),
  sendMessageTitle: makeStringProp(''),
  sendMessagePath: makeStringProp(''),
  sendMessageImg: makeStringProp(''),
  showMessageCard: makeBooleanProp(false),
  hoverStartTime: makeNumericProp(0),
  hoverStayTime: makeNumericProp(300),
  openType: makeStringProp(''),
  scope: makeStringProp(''),
}

export type ButtonProps = ExtractPropTypes<typeof buttonProps>
